#region Copyright (c) 2013-03, Olaf Kober <amarok.projects@gmail.com>
//================================================================================
//	Permission is hereby granted, free of charge, to any person obtaining a copy
//	of this software and associated documentation files (the "Software"), to deal
//	in the Software without restriction, including without limitation the rights
//	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//	copies of the Software, and to permit persons to whom the Software is
//	furnished to do so, subject to the following conditions:
//
//	The above copyright notice and this permission notice shall be included in
//	all copies or substantial portions of the Software.
//
//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//	THE SOFTWARE.
//================================================================================
#endregion

using System;


namespace Amarok.Agents
{
	/// <summary>
	/// This type represents the runtime environment that is provided by the agent runtime to its hosted agents. 
	/// This specific runtime environment provides agents with references to the hosting runtime and also to the 
	/// central message bus.
	/// 
	/// You can derive your own runtime environment from this base class and extend it as needed. As with all 
	/// agent environments, one runtime environment instance is shared between multiple agents to provide the 
	/// same services to all those agents.
	/// </summary>
	public class RuntimeEnvironment : AgentEnvironment
	{
		/// <summary>
		/// Gets a reference to the runtime that serves as hosts for agents.
		/// </summary>
		public IRuntime Runtime
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets a reference to the central message bus used to connect agents.
		/// </summary>
		public IMessageBus MessageBus
		{
			get;
			private set;
		}


		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		/// 
		/// <param name="runtime">
		/// A reference to the runtime that serves as hosts for agents.</param>
		/// <param name="messageBus">
		/// A reference to the central message bus used to connect agents.</param>
		/// 
		/// <exception cref="ArgumentNullException">
		/// A null reference was passed to a method that did not accept it as a valid argument.</exception>
		public RuntimeEnvironment(IRuntime runtime, IMessageBus messageBus)
		{
			Verify.NotNull(runtime, "runtime");
			Verify.NotNull(messageBus, "messageBus");

			this.Runtime = runtime;
			this.MessageBus = messageBus;
		}

	}
}
